package com.lx.design.demo.learning.liu.visitor;

import com.google.common.collect.Lists;

import java.util.ArrayList;

/**
 * @author lx
 * @date 2021/3/1 17:35
 */
public class EmployeeList {

    private ArrayList<Employee> list = Lists.newArrayList();

    public void addEmployee(Employee emloyee) {
        list.add(emloyee);
    }

    public void accept(Department handler) {
        list.forEach(employee -> employee.accept(handler));
    }
}
